Compare commits
1 Commits
master
...
ZombieDrop
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2e25241865 |
20
build.gradle
20
build.gradle
@ -9,13 +9,12 @@ buildscript {
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
version = '1.0'
|
||||
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = 'modid'
|
||||
group = 'com.punkcraft.zombiedrop'
|
||||
archivesBaseName = 'zombiedrop'
|
||||
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
|
||||
@ -45,21 +44,6 @@ dependencies {
|
||||
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
|
||||
}
|
||||
|
||||
// Example for how to get properties into the manifest for reading by the runtime..
|
||||
jar {
|
||||
manifest {
|
||||
attributes([
|
||||
"Specification-Title": "examplemod",
|
||||
"Specification-Vendor": "examplemodsareus",
|
||||
"Specification-Version": "1", // We are version 1 of ourselves
|
||||
"Implementation-Title": project.name,
|
||||
"Implementation-Version": "${version}",
|
||||
"Implementation-Vendor" :"examplemodsareus",
|
||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
jar.finalizedBy('reobfJar')
|
||||
|
||||
publishing {
|
||||
|
@ -1,23 +0,0 @@
|
||||
package com.punkcraft.example;
|
||||
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
|
||||
|
||||
@Mod(modid = Example.MODID, name = Example.NAME, version = Example.VERSION)
|
||||
public class Example {
|
||||
public static final String MODID = "example";
|
||||
public static final String NAME = "Example";
|
||||
public static final String VERSION = "1.0";
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
}
|
||||
|
||||
|
||||
}
|
12
src/main/java/com/punkcraft/zombiedrop/ClientProxy.java
Normal file
12
src/main/java/com/punkcraft/zombiedrop/ClientProxy.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.punkcraft.zombiedrop;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {}
|
||||
}
|
10
src/main/java/com/punkcraft/zombiedrop/CommonProxy.java
Normal file
10
src/main/java/com/punkcraft/zombiedrop/CommonProxy.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.punkcraft.zombiedrop;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class CommonProxy {
|
||||
public void preInit(FMLPreInitializationEvent event) {}
|
||||
|
||||
public void init(FMLInitializationEvent event) {}
|
||||
}
|
42
src/main/java/com/punkcraft/zombiedrop/ServerProxy.java
Normal file
42
src/main/java/com/punkcraft/zombiedrop/ServerProxy.java
Normal file
@ -0,0 +1,42 @@
|
||||
package com.punkcraft.zombiedrop;
|
||||
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class ServerProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingDrops(LivingDropsEvent event) {
|
||||
if (event.getEntityLiving() instanceof EntityZombie) {
|
||||
EntityZombie zombie = (EntityZombie) event.getEntityLiving();
|
||||
DamageSource source = event.getSource();
|
||||
|
||||
if (source.getTrueSource() != null || source.isExplosion()) {
|
||||
int random = zombie.world.rand.nextInt(100);
|
||||
if (random < 4) {
|
||||
ItemStack enderPearl = new ItemStack(Item.getItemById(368), 1);
|
||||
World world = zombie.world;
|
||||
double x = zombie.posX;
|
||||
double y = zombie.posY;
|
||||
double z = zombie.posZ;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x, y, z, enderPearl);
|
||||
event.getDrops().add(entityItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
26
src/main/java/com/punkcraft/zombiedrop/ZombieDrop.java
Normal file
26
src/main/java/com/punkcraft/zombiedrop/ZombieDrop.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.punkcraft.zombiedrop;
|
||||
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
@Mod(modid = ZombieDrop.MODID, name = ZombieDrop.NAME, version = ZombieDrop.VERSION, canBeDeactivated = true, acceptableRemoteVersions = "*")
|
||||
public class ZombieDrop {
|
||||
public static final String MODID = "zombiedrop";
|
||||
public static final String NAME = "ZombieDrop";
|
||||
public static final String VERSION = "1.0";
|
||||
|
||||
@SidedProxy(serverSide = "com.punkcraft.zombiedrop.ServerProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
proxy.preInit(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
proxy.init(event);
|
||||
}
|
||||
}
|
@ -1,16 +1,16 @@
|
||||
[
|
||||
{
|
||||
"modid": "example",
|
||||
"name": "Example",
|
||||
"description": "",
|
||||
"version": "${version}",
|
||||
"mcversion": "${mcversion}",
|
||||
"url": "",
|
||||
"updateUrl": "",
|
||||
"authorList": ["PIVODEVAT"],
|
||||
"credits": "",
|
||||
"logoFile": "",
|
||||
"screenshots": [],
|
||||
"dependencies": []
|
||||
}
|
||||
{
|
||||
"modid": "zombiedrop",
|
||||
"name": "ZombieDrop",
|
||||
"description": "Добавляет 99% шанс дропа эндерпёрла с зомби. Мод работает только на сервере и не требует установки на клиенте.",
|
||||
"version": "1.0",
|
||||
"mcversion": "1.12.2",
|
||||
"url": "",
|
||||
"updateUrl": "",
|
||||
"authorList": ["PIVODEVAT"],
|
||||
"credits": "",
|
||||
"logoFile": "",
|
||||
"screenshots": [],
|
||||
"dependencies": [],
|
||||
}
|
||||
]
|
||||
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "examplemod resources",
|
||||
"pack_format": 3,
|
||||
"_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)."
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user