-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for all Minecraft versions
- Loading branch information
Showing
9 changed files
with
264 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...r/src/v1_16_5/java/de/neocraftr/griefergames/v1_16_5/VersionedGrieferGamesController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package de.neocraftr.griefergames.v1_16_5; | ||
|
||
import de.neocraftr.griefergames.utils.GrieferGamesController; | ||
import net.labymod.api.models.Implements; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.inventory.ContainerScreen; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
@Singleton | ||
@Implements(GrieferGamesController.class) | ||
public class VersionedGrieferGamesController extends GrieferGamesController { | ||
|
||
@Inject | ||
public VersionedGrieferGamesController() {} | ||
|
||
@Override | ||
public boolean playerAllowedFlying() { | ||
return Minecraft.getInstance().player.abilities.mayfly; | ||
} | ||
|
||
@Override | ||
public boolean hideBoosterMenu() { | ||
if(Minecraft.getInstance().player == null) return false; | ||
|
||
Screen screen = Minecraft.getInstance().screen; | ||
if(screen instanceof ContainerScreen) { | ||
if(screen.getTitle().getString().equals("§6Booster - Übersicht")) { | ||
Minecraft.getInstance().player.closeContainer(); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...r/src/v1_17_1/java/de/neocraftr/griefergames/v1_17_1/VersionedGrieferGamesController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package de.neocraftr.griefergames.v1_17_1; | ||
|
||
import de.neocraftr.griefergames.utils.GrieferGamesController; | ||
import net.labymod.api.models.Implements; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.inventory.ContainerScreen; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
@Singleton | ||
@Implements(GrieferGamesController.class) | ||
public class VersionedGrieferGamesController extends GrieferGamesController { | ||
|
||
@Inject | ||
public VersionedGrieferGamesController() {} | ||
|
||
@Override | ||
public boolean playerAllowedFlying() { | ||
return Minecraft.getInstance().player.getAbilities().mayfly; | ||
} | ||
|
||
@Override | ||
public boolean hideBoosterMenu() { | ||
if(Minecraft.getInstance().player == null) return false; | ||
|
||
Screen screen = Minecraft.getInstance().screen; | ||
if(screen instanceof ContainerScreen) { | ||
if(screen.getTitle().getString().equals("§6Booster - Übersicht")) { | ||
Minecraft.getInstance().player.closeContainer(); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...r/src/v1_18_2/java/de/neocraftr/griefergames/v1_18_2/VersionedGrieferGamesController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package de.neocraftr.griefergames.v1_18_2; | ||
|
||
import de.neocraftr.griefergames.utils.GrieferGamesController; | ||
import net.labymod.api.models.Implements; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.inventory.ContainerScreen; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
@Singleton | ||
@Implements(GrieferGamesController.class) | ||
public class VersionedGrieferGamesController extends GrieferGamesController { | ||
|
||
@Inject | ||
public VersionedGrieferGamesController() {} | ||
|
||
@Override | ||
public boolean playerAllowedFlying() { | ||
return Minecraft.getInstance().player.getAbilities().mayfly; | ||
} | ||
|
||
@Override | ||
public boolean hideBoosterMenu() { | ||
if(Minecraft.getInstance().player == null) return false; | ||
|
||
Screen screen = Minecraft.getInstance().screen; | ||
if(screen instanceof ContainerScreen) { | ||
if(screen.getTitle().getString().equals("§6Booster - Übersicht")) { | ||
Minecraft.getInstance().player.closeContainer(); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...r/src/v1_19_2/java/de/neocraftr/griefergames/v1_19_2/VersionedGrieferGamesController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package de.neocraftr.griefergames.v1_19_2; | ||
|
||
import de.neocraftr.griefergames.utils.GrieferGamesController; | ||
import net.labymod.api.models.Implements; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.inventory.ContainerScreen; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
@Singleton | ||
@Implements(GrieferGamesController.class) | ||
public class VersionedGrieferGamesController extends GrieferGamesController { | ||
|
||
@Inject | ||
public VersionedGrieferGamesController() {} | ||
|
||
@Override | ||
public boolean playerAllowedFlying() { | ||
return Minecraft.getInstance().player.getAbilities().mayfly; | ||
} | ||
|
||
@Override | ||
public boolean hideBoosterMenu() { | ||
if(Minecraft.getInstance().player == null) return false; | ||
|
||
Screen screen = Minecraft.getInstance().screen; | ||
if(screen instanceof ContainerScreen) { | ||
if(screen.getTitle().getString().equals("§6Booster - Übersicht")) { | ||
Minecraft.getInstance().player.closeContainer(); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...r/src/v1_19_3/java/de/neocraftr/griefergames/v1_19_3/VersionedGrieferGamesController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package de.neocraftr.griefergames.v1_19_3; | ||
|
||
import de.neocraftr.griefergames.utils.GrieferGamesController; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
import net.labymod.api.models.Implements; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.inventory.ContainerScreen; | ||
|
||
@Singleton | ||
@Implements(GrieferGamesController.class) | ||
public class VersionedGrieferGamesController extends GrieferGamesController { | ||
|
||
@Inject | ||
public VersionedGrieferGamesController() {} | ||
|
||
@Override | ||
public boolean playerAllowedFlying() { | ||
return Minecraft.getInstance().player.getAbilities().mayfly; | ||
} | ||
|
||
@Override | ||
public boolean hideBoosterMenu() { | ||
if(Minecraft.getInstance().player == null) return false; | ||
|
||
Screen screen = Minecraft.getInstance().screen; | ||
if(screen instanceof ContainerScreen) { | ||
if(screen.getTitle().getString().equals("§6Booster - Übersicht")) { | ||
Minecraft.getInstance().player.closeContainer(); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...r/src/v1_19_4/java/de/neocraftr/griefergames/v1_19_4/VersionedGrieferGamesController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package de.neocraftr.griefergames.v1_19_4; | ||
|
||
import de.neocraftr.griefergames.utils.GrieferGamesController; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
import net.labymod.api.models.Implements; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.inventory.ContainerScreen; | ||
|
||
@Singleton | ||
@Implements(GrieferGamesController.class) | ||
public class VersionedGrieferGamesController extends GrieferGamesController { | ||
|
||
@Inject | ||
public VersionedGrieferGamesController() {} | ||
|
||
@Override | ||
public boolean playerAllowedFlying() { | ||
return Minecraft.getInstance().player.getAbilities().mayfly; | ||
} | ||
|
||
@Override | ||
public boolean hideBoosterMenu() { | ||
if(Minecraft.getInstance().player == null) return false; | ||
|
||
Screen screen = Minecraft.getInstance().screen; | ||
if(screen instanceof ContainerScreen) { | ||
if(screen.getTitle().getString().equals("§6Booster - Übersicht")) { | ||
Minecraft.getInstance().player.closeContainer(); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...r/src/v1_20_1/java/de/neocraftr/griefergames/v1_20_1/VersionedGrieferGamesController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package de.neocraftr.griefergames.v1_20_1; | ||
|
||
import de.neocraftr.griefergames.utils.GrieferGamesController; | ||
import net.labymod.api.models.Implements; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.inventory.ContainerScreen; | ||
import net.minecraft.world.Container; | ||
import net.minecraft.world.SimpleContainer; | ||
import net.minecraft.world.inventory.AbstractContainerMenu; | ||
import net.minecraft.world.inventory.ChestMenu; | ||
import net.minecraft.world.inventory.InventoryMenu; | ||
import net.minecraft.world.level.block.entity.HopperBlockEntity; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
@Singleton | ||
@Implements(GrieferGamesController.class) | ||
public class VersionedGrieferGamesController extends GrieferGamesController { | ||
|
||
@Inject | ||
public VersionedGrieferGamesController() {} | ||
|
||
@Override | ||
public boolean playerAllowedFlying() { | ||
return Minecraft.getInstance().player.getAbilities().mayfly; | ||
} | ||
|
||
@Override | ||
public boolean hideBoosterMenu() { | ||
if(Minecraft.getInstance().player == null) return false; | ||
|
||
Screen screen = Minecraft.getInstance().screen; | ||
if(screen instanceof ContainerScreen) { | ||
if(screen.getTitle().getString().equals("§6Booster - Übersicht")) { | ||
Minecraft.getInstance().player.closeContainer(); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |