2017-05-29 09:10:40 +00:00
|
|
|
package net.minecraftforge.debug;
|
2016-07-23 03:08:38 +00:00
|
|
|
|
|
|
|
import net.minecraft.init.Blocks;
|
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
|
|
|
import net.minecraftforge.event.world.BlockEvent.CreateFluidSourceEvent;
|
|
|
|
import net.minecraftforge.fml.common.Mod;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
|
|
|
2016-11-22 20:12:13 +00:00
|
|
|
@Mod(modid = "createfluidsourcetest", name = "CreateFluidSourceTest", version = "1.0", acceptableRemoteVersions = "*")
|
2016-07-23 03:08:38 +00:00
|
|
|
public class CreateFluidSourceTest
|
|
|
|
{
|
|
|
|
public static final boolean ENABLE = false;
|
|
|
|
|
|
|
|
@Mod.EventHandler
|
|
|
|
public static void init(FMLInitializationEvent event)
|
|
|
|
{
|
|
|
|
if (ENABLE)
|
2017-05-29 09:10:40 +00:00
|
|
|
{
|
2016-07-23 03:08:38 +00:00
|
|
|
MinecraftForge.EVENT_BUS.register(CreateFluidSourceTest.class);
|
2017-05-29 09:10:40 +00:00
|
|
|
}
|
2016-07-23 03:08:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@SubscribeEvent
|
|
|
|
public static void onCreateFluidSource(CreateFluidSourceEvent event)
|
|
|
|
{
|
|
|
|
// make it work exactly the opposite of how it works by default
|
|
|
|
if (event.getState().getBlock() == Blocks.FLOWING_WATER)
|
2017-05-29 09:10:40 +00:00
|
|
|
{
|
2016-07-23 03:08:38 +00:00
|
|
|
event.setResult(Result.DENY);
|
2017-05-29 09:10:40 +00:00
|
|
|
}
|
2016-07-23 03:08:38 +00:00
|
|
|
else
|
2017-05-29 09:10:40 +00:00
|
|
|
{
|
2016-07-23 03:08:38 +00:00
|
|
|
event.setResult(Result.ALLOW);
|
2017-05-29 09:10:40 +00:00
|
|
|
}
|
2016-07-23 03:08:38 +00:00
|
|
|
}
|
|
|
|
}
|